<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Grouping</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="parle.regex.anchors.html">« Anchors</a></li>
      <li style="float: right;"><a href="parle.examples.html">范例 »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="parle.pattern.matching.html">Pattern matching</a></li>
    <li>Grouping</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="parle.regex.grouping" class="section">
  <h2 class="title">Grouping</h2>
  <p class="para">
   <table class="doctable table">
    <caption><strong>Grouping</strong></caption>
    
     <thead>
      <tr>
       <th>Sequence</th><th>Description</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>(...)</td><td>Group a regular expression to override default operator precedence.</td>
      </tr>

      <tr>
       <td style="vertical-align: top;">(?r-s:pattern)</td>
       <td>
        Apply option r and omit option s while interpreting pattern. Options may be zero or more of the characters i, s, or x.
        <table class="doctable table">
         <caption><strong>Options</strong></caption>
          
           <thead>
            <tr>
             <th>Option</th><th>Description</th>
            </tr>

           </thead>

          <tbody class="tbody">
            <tr>
             <td>i</td><td>Case insensitive.</td>
            </tr>

            <tr>
             <td>-i</td><td>Case sensitive.</td>
            </tr>

            <tr>
             <td>s</td><td>Alters the meaning of &#039;.&#039; to match any character whatsoever.</td>
            </tr>

            <tr>
             <td>-s</td><td>Alters the meaning of &#039;.&#039; to match any character except &#039;\n&#039;.</td>
            </tr>

            <tr>
             <td>x</td><td>Ignores comments and whitespace in patterns. Whitespace is ignored unless it is backslash-escaped, contained within &quot;&quot;s, or appears inside a character range.</td>
            </tr>

          </tbody>
         
        </table>

        These options can be applied globally at the rules level by passing a combination of the bit flags to the lexer.
       </td>
      </tr>

      <tr>
       <td>(?# comment )</td><td>Omit everything within (). The first ) character encountered ends the pattern. It is not possible for the comment to contain a ) character. The comment may span lines.</td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div></div></div></body></html>